<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div>Users:</div>
    <ul>
        <li>John</li>
        <li>Pete</li>
    </ul>
    <script>
        //<div> DOM 节点？
        var a1 = document.querySelector('div');
        var a2 = document.body.firstElementChild;
        var a3 = document.querySelector('ul').previousElementSibling;
        console.log(a1, a2, a3);
        //<ul> DOM 节点？
        var b1 = document.querySelector('ul');
        console.log(b1);
        //第二个 <li> 节点（即包含 Pete 的节点）？
        var c1 = document.querySelector('ul').lastElementChild;
        // var c2 = document.querySelector('#p');设置id选择器
        var c3 = document.querySelectorAll('li');
        console.log(c1, c3[1]);
    </script>
</body>

</html>